<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>

  </style>
</head>

<body>
  <div id="app"></div>

  <script src="node_modules/@babel/standalone/babel.js"></script>
  <script src="node_modules/react/umd/react.development.js"></script>
  <script src="node_modules/react-dom/umd/react-dom.development.js"></script>

  <script type="text/babel">
    const fruits=[
    <li key="1">apple</li>,
    <li key="2">banana</li>,
    <li key="3">melen</li>,
    <li key="4">shit</li>
  ]
    const todoList=[
      {
        id:1,
        title:'eat'
      },
      {
        id:2,
        title:'sleep'
      },
      {
        id:3,
        title:'drink'
      },
      {
        id:4,
        title:'walk'
      }
    ]    
    // const els=[]
    // todoList.forEach((item)=>{
    //   els.push(<li key={item.id}>{item.title}</li>)
    // })
    const els=todoList.map(item=>{
      return <li key={item.id}>{item.title}</li>
    })
    const element = ( 
      <div>
        <ul>{fruits}</ul>
        <ul>{els}</ul>
        <ul>
          {
            todoList.map(item=>{
      return <li key={item.id}>{item.title}</li>
            })
          }
          </ul>
      </div>  
        )
    ReactDOM.render(
      element,
      document.getElementById('app')
    )
  </script>
</body>

</html>